﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="Add_course.aspx.cs" Inherits="Admin_Add_course" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style9
        {
            width: 477px;
            text-align: center;
        }
        .style10
        {
            width: 16px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td colspan="3" style="text-align: center">
                <asp:Label ID="Label1" runat="server" Text="Add" 
                    style="font-weight: 700; color: #0066FF"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style9">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style9">
                <asp:Label ID="Label3" runat="server" Text="Title"></asp:Label>
            </td>
            <td class="style10">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style9">
                <asp:Label ID="Label4" runat="server" Text="File Path"></asp:Label>
            </td>
            <td class="style10">
                &nbsp;</td>
            <td>
                <asp:FileUpload ID="fulFilePath" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style9">
                <asp:Label ID="Label5" runat="server" Text="Uploaded Date"></asp:Label>
            </td>
            <td class="style10">
                &nbsp;</td>
            <td>
                <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
            </td>
        </tr>
        <tr>
            <td class="style9">
                <asp:Label ID="Label6" runat="server" Text="Uploaded User Id"></asp:Label>
            </td>
            <td class="style10">
                &nbsp;</td>
            <td>
                <asp:DropDownList ID="ddlUploadId" runat="server">
                    <asp:ListItem></asp:ListItem>
                    <asp:ListItem>1</asp:ListItem>
                    <asp:ListItem>2</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style9">
                <asp:Label ID="Label7" runat="server" Text="Program Id"></asp:Label>
            </td>
            <td class="style10">
                &nbsp;</td>
            <td>
                <asp:DropDownList ID="ddlProgramId" runat="server" 
                    DataSourceID="SqlDataSource2" DataTextField="programId" 
                    DataValueField="programId">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    SelectCommand="SELECT [programId] FROM [tblProgram]"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style9">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    DeleteCommand="DELETE FROM [tblCourseOutline] WHERE [courseOutlineId] = @courseOutlineId" 
                    InsertCommand="INSERT INTO [tblCourseOutline] ([courseOutlineTile], [filePath], [uploadedDate], [uploadedUserId], [programId]) VALUES (@courseOutlineTile, @filePath, @uploadedDate, @uploadedUserId, @programId)" 
                    SelectCommand="SELECT * FROM [tblCourseOutline]" 
                    UpdateCommand="UPDATE [tblCourseOutline] SET [courseOutlineTile] = @courseOutlineTile, [filePath] = @filePath, [uploadedDate] = @uploadedDate, [uploadedUserId] = @uploadedUserId, [programId] = @programId WHERE [courseOutlineId] = @courseOutlineId">
                    <DeleteParameters>
                        <asp:Parameter Name="courseOutlineId" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="courseOutlineTile" Type="String" />
                        <asp:Parameter Name="filePath" Type="String" />
                        <asp:Parameter Name="uploadedDate" Type="DateTime" />
                        <asp:Parameter Name="uploadedUserId" Type="Int32" />
                        <asp:Parameter Name="programId" Type="Int32" />
                        <asp:Parameter Name="courseOutlineId" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="txtTitle" Name="courseOutlineTile" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="fulFilePath" Name="filePath" 
                            PropertyName="FileName" Type="String" />
                        <asp:ControlParameter ControlID="Calendar1" Name="uploadedDate" 
                            PropertyName="SelectedDate" Type="DateTime" />
                        <asp:ControlParameter ControlID="ddlUploadId" Name="uploadedUserId" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="ddlProgramId" Name="programId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
            <td class="style10">
                <asp:Button ID="bntEdit1" runat="server" onclick="bntEdit1_Click" Text="Add" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

